(function() {

	var appModule = angular.module('tracecashModule');

	appModule.directive('recipientList', function() {
		return {
			restrict : 'AE',
			templateUrl : 'html/sinister/sinister-recipient-list.html',
			controller : 'RecipientListCtrl',
			require : '^ngModel',
			scope : {
				recipients : '=ngModel',
				maxRecipients : '=maxRecipients'
			}
		};
	});

	appModule.controller('RecipientListCtrl', [ '$scope', '$routeParams', '$http', function($scope, $routeParams, $http) {
		$scope.add = function(entityType) {
			$scope.recipients.push({
				"recipient" : {
					"entityType" : entityType
				}
			});
		};
		$scope.remove = function(index) {
			$scope.recipients.splice(index, 1);
		};
	} ]);

})();